{template header}
    <header>
        <a href="javascript:;" onClick="javascript :history.back(-1);" class="headerL iconfont">&#xe66a;</a>
        <h1>交易详情</h1>
    </header>
    <!-- E header -->

    <!-- S 交易状态 -->
    <dl class="my_deal_condition">
        <dt><img src="{THEME_PATH}images/deal1.png" alt="" width="102" class="ico"></dt>
        <dd class="tit">挂单中</dd>
        <dd id="c_down_">--</dd>
    </dl>
    <script type="text/javascript">
        $(function(){
            countDown(<?php echo $tinfo['ctime']?>);
        })
    </script>
    <!-- E 交易状态 -->

    <h2 class="my_deal_h2">交易信息</h2>
    <ul class="my_deal_msg_items">
        <li class="flex flex-pack-justify">
            <div>编号</div>
            <div>{$tinfo[order_sn]}</div>
        </li>
        <li class="flex flex-pack-justify">
            <div>数量(DBT)</div>
            <div>{$tinfo[num]}</div>
        </li>
        <li class="flex flex-pack-justify">
            <div>单价(USD)</div>
            <div>{$tinfo[price]}</div>
        </li>
        <li class="flex flex-pack-justify">
            <div>总价(USD)</div>
            <div>{$tinfo[amount]}</div>
        </li>

        <li class="flex flex-pack-justify">
            <div>总价(CNY)</div>
            <div>{$tinfo[cny]}</div>
        </li>

        <li class="flex flex-pack-justify">
            <div>时间</div>
            <div>2018-8-1 14:00:13</div>
        </li>
    </ul>



</body>


<link href="/statics/js/webuploader/webuploader.css" rel="stylesheet" />
<script src="/statics/js/webuploader/webuploader.js" type="text/javascript"></script>
<script type="text/javascript">


    var img1 = new WebUploader.create({
        auto:true,
        fileVal:'upfile',
        // swf文件路径
        swf: '/statics/js/webuploader/webuploader.swf',
        // 文件接收服务端。
        server: "/index.php?m=attachment&c=upload&a=swfupload",
        // 选择文件的按钮。可选
        formData:{
            "module":"",
            "catid":"",
            "userid":"1",
            "dosubmit":"1",
            "thumb_width":"0",
            "thumb_height":"0",
            "watermark_enable":"1",
            "filetype_post":"jpg|jpeg|gif|bmp|png",
            "swf_auth_key":"57a39f6f7415ec2cdd2b8afd77b57c3f",
            "isadmin":"1"
        },
        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
        pick: {
            id: '#img1_box',
            multiple:false
        },
        accept:{
            title: '图片文件',
            extensions: 'gif,jpg,jpeg,bmp,png',
            mimeTypes: 'image/*'
        },
        thumb:{
            width: '110',
            height: '110',
        },
        chunked: false,
        chunkSize:1000000,
        // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
        resize: false
    });
    img1.onUploadSuccess = function( file, response ) {
        var pickid = this.options.pick.id;
        var data = response._raw;
        var arr = data.split(',');
        if(response.url.length > 0) {
            $(pickid).find('img').attr('src', response.url);
            // $(pickid).find('input[type=hidden]').eq(0).attr('value', response.url);
            $("#pic").attr('value', response.url);
        }
        console.log(response);
    }
    img1.onUploadError = function(file, reason) {
        hd_alert('文件上传错误：' + reason);
    }


    var inx;
    function submitForm(){
        layer.open({type: 2});

        var pic = $("#pic").val();
        var id = <?php echo $tinfo['id']?>;
        
        $.ajax({
            type:'post',
            url:'/index.php?m=user&c=trade&a=picadd',
            data:{id:id,pic:pic},
            dataType:'json',
            success:function(ret){
              layer.closeAll();
              console.log(ret);
              if(ret.status==1){
                  tips(ret.info,'/index.php?m=user&c=trade&a=tradedetail&id=<?php echo $tinfo['id']?>');
              }else{
                  tips(ret.info);
              }
            }
        })

    }




function countDown(times){
  var timer=null;
  timer=setInterval(function(){
    var day=0,
      hour=0,
      minute=0,
      second=0;//时间默认值
    if(times > 0){
      // day = Math.floor(times / (60 * 60 * 24));
      hour = Math.floor(times / (60 * 60)) - (day * 24);
      minute = Math.floor(times / 60) - (day * 24 * 60) - (hour * 60);
      second = Math.floor(times) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
    }
    // if (day <= 9) day = '0' + day;
    if (hour <= 9) hour = '0' + hour;
    if (minute <= 9) minute = '0' + minute;
    if (second <= 9) second = '0' + second;
    $("#c_down_").html("倒计时&nbsp;"+hour+":"+minute+":"+second);
    // console.log(hour+":"+minute+":"+second);
    times--;
  },1000);
  if(times<=0){
    clearInterval(timer);
  }
}


</script>


</html>